<?php
namespace Home\Model;
use Think\Model;
    class CategoryModel  extends Model {
        public function getPidList($cid){
            $pcat=array();
            while ($cid)
            {
                $cat=$this->where("cid=$cid")->find();
                $pcat[]=array(
                    
                    'cid'=>$cat['cid'],
                    'cname'=>$cat['cname'],
                    
                
                );
                $cid=$cat['pid'];
                
            }
            return array_reverse($pcat);
        }
        
    }


